package com.cn.yz.server.hi.controller;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.client.RestTemplate;

@RestController
public class HiController {
	
		private static Logger LOG = LoggerFactory.getLogger(HiController.class);
	
	 	@Autowired
	    private RestTemplate restTemplate;

	    @RequestMapping("/hi")
	    public String callHome(){
	    	LOG.info("calling trace service-hi  ");
	        return restTemplate.getForObject("http://localhost:8901/miya", String.class);
	    }
	    
	    @RequestMapping("/hiinfo")
	    public String info(){
	    	LOG.info("calling trace service-hi ");
	        return "i'm service-hi";

	    }



}
